include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_library(processor STATIC processor.cxx)
macro(build_processor name)
	add_library(processor_${name} MODULE ${name}_processor.cxx)
	target_link_libraries(processor_${name} ${ARGN} processor)
	set_target_properties(processor_${name} PROPERTIES PREFIX "" OUTPUT_NAME ${name})
	install(TARGETS processor_${name} DESTINATION ${PROCESSOR_INSTALL_DIR})
endmacro(build_processor)

build_processor(prepare utf8 lexicon trie)
build_processor(maxforward utf8 lexicon trie)
build_processor(unigram utf8 lexicon trie)
build_processor(single_combine utf8 lexicon trie)
build_processor(maxforward_combine utf8 lexicon trie)
build_processor(break utf8 lexicon trie)


find_package(CRFPP)

if (CRFPP_FOUND)
	build_processor(crf utf8 -lcrfpp)
	build_processor(crf2 -lcrfpp)
	build_processor(pos -lcrfpp)
endif (CRFPP_FOUND)
